#-*- codeing = utf-8 -*-
#@Time : 2020/10/30 13:11
#@Author : 阳某
#@File : 01.python读取excel绘制柱状图.py
#@Software : PyCharm

# 读取excel数据
import pandas as pd
df = pd.read_excel('./datas/服装销售数据.xlsx')
print(df)

# 绘制柱状图
from pyecharts import options as opts
from pyecharts.charts import Bar
bar = (
    Bar()
    .add_xaxis(df["商品"].to_list())
    .add_yaxis("商家A", df["商家A"].to_list())
    .add_yaxis("商家B", df["商家B"].to_list())
    .set_global_opts(title_opts=opts.TitleOpts(title="商品销量对比图"))
)
bar.render_notebook()